package org.shareworth.online_life.action.portal;

import org.apache.struts2.json.annotations.JSON;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionSupport;

@Controller("action.portal.login")
public class LoginAction extends ActionSupport {

	private String userName;

	private String passWord;

	private boolean result;
	
	@JSON
	public boolean getResult() {
		return result;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public void setPassWord(String passWord) {
		this.passWord = passWord;
	}

	@Override
	public String execute() throws Exception {
		if("admin".equals(userName)&&"yuwenzhen520".equals(passWord))
			result = true;
		else {
			result = false;
		}
		return "success";
	}

}
